Skip to main content

Quoting

Quoting

Quote TypeSyntaxUsecaseOutput
Escape character\echo "I'm a double quote \""I'm a double quote "
Single Quote'string'echo '$(echo hello) from the other side'$(echo hello) from the other side
Double Quote"string"Evaluates expressionecho "$(echo hello) from the other side"hello from the other side
ANSI-C Quoting$'string'Enables ANSI-C Quotingecho $'1\n2\n3\n4'
1
2
3
4
Locale-Specific Translation$"string"

Ref: https://www.gnu.org/software/bash/manual/html_node/Quoting.html